package edu.scut.course_management.dto;
import edu.scut.course_management.po.Student;
import edu.scut.course_management.po.Major;
import edu.scut.course_management.po.Department;

/**
 *  用于封装请求课程学生信息列表的数据对象
 *  @author thompson
 */
public class GetListOfStudentsDTO {
    private String studentId;
    private String name;
    private String male;
    private String phoneNumber;
    private String departmentName;
    private String majorName;
    private String enrollmentYear;
    private String className;

    public String getStudentId() {
        return studentId;
    }

    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMale() {
        return male;
    }

    public void setMale(String male) {
        this.male = male;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }

    public String getMajorName() {
        return majorName;
    }

    public void setMajorName(String majorName) {
        this.majorName = majorName;
    }

    public String getEnrollmentYear() {
        return enrollmentYear;
    }

    public void setEnrollmentYear(String enrollmentYear) {
        this.enrollmentYear = enrollmentYear;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    

    public void setStudentInfoOfList(Student student, Major major, Department department){
        setStudentId(student.getStudentId());
        setName(student.getName());
        if(student.isMale()){
            setMale("女");
        }
        else{
            setMale("男");
        }
        setPhoneNumber(student.getPhoneNumber());
        setEnrollmentYear(student.getEnrollmentYear());
        setClassName(student.getClassName());

        setMajorName(major.getMajorName());

        setDepartmentName(department.getDepartmentName());
    }

    @Override
    public String toString() {
        return "GetListOfStudentsDTO [className=" + className + ", departmentName=" + departmentName
                + ", enrollmentYear=" + enrollmentYear + ", majorName=" + majorName + ", male=" + male + ", name="
                + name + ", phoneNumber=" + phoneNumber + ", studentId=" + studentId + "]";
    }
}